Fix PlayerProfile applySkinToPlayerHeadContents#13692
Open
MrKinau wants to merge 1 commit intoPaperMC:mainfrom
Open
Fix PlayerProfile applySkinToPlayerHeadContents#13692MrKinau wants to merge 1 commit intoPaperMC:mainfrom
MrKinau wants to merge 1 commit intoPaperMC:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #13585
PlayerandOfflinePlayercorrectly set their full profile asSkinSource. When using a profile without texture properties, but with a name AND an id the current behavior sets both even when no properties are set, which results in the displayed player head being rendered as a default skin. I suggest that in the case that no properties are present the client should fetch the profile, which is only possible when id OR name are set (not both).This fixes the displayed skin head of offline players (letting the client fetch the profile) as OfflinePlayers have no skin data stored.
^ currently displays some default skin, but with this PR let's the client fetch the profile and displays the correct skin
Theoretically the current code could work, but only if either name or id is null, however this is not the case for offline players, dunno if this is another bug or intentional, but the PlayerProfiles of OfflinePlayers have an empty (not null, but empty) string as name (when get by UUID, when get by name they have their correct name) and a uuid. Thats weird as the
org.bukkit.craftbukkit.profile.CraftPlayerProfile(imo) correctly checks if the name is empty and returns null instead, but if this is not intended the correct fix would prob. be to set the name instead of letting it return null instead of an empty string.I only changed the behavior of
PlayerProfile#applySkinToPlayerHeadContentsto fix this issue and did not change the empty string name. The only behavior change is noticeable when having id AND name set and no properties (in that case it prefers the uuid and ignores the name to let the client fetch the profile).